package color.koitq.picker.entity;

import android.os.Parcel;
import android.os.Parcelable;

import java.util.ArrayList;

public class ColorGroupModel implements Parcelable {
    private String name;
    private String sampleColor;
    private int groupId;
    private ArrayList<PaletteModel> paletteModelList;
    private ArrayList<ColorGroupModel> homeList;

    public ColorGroupModel() {
    }

    protected ColorGroupModel(Parcel in) {
        name = in.readString();
        sampleColor = in.readString();
        groupId = in.readInt();
        paletteModelList = in.createTypedArrayList(PaletteModel.CREATOR);
        homeList = in.createTypedArrayList(ColorGroupModel.CREATOR);
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeString(name);
        dest.writeString(sampleColor);
        dest.writeInt(groupId);
        dest.writeTypedList(paletteModelList);
        dest.writeTypedList(homeList);
    }

    @Override
    public int describeContents() {
        return 0;
    }

    public static final Creator<ColorGroupModel> CREATOR = new Creator<ColorGroupModel>() {
        @Override
        public ColorGroupModel createFromParcel(Parcel in) {
            return new ColorGroupModel(in);
        }

        @Override
        public ColorGroupModel[] newArray(int size) {
            return new ColorGroupModel[size];
        }
    };

    public ArrayList<ColorGroupModel> getHomeList() {
        return homeList;
    }

    public void setHomeList(ArrayList<ColorGroupModel> homeList) {
        this.homeList = homeList;
    }

    public ArrayList<PaletteModel> getPaletteModelList() {
        return paletteModelList;
    }

    public void setPaletteModelList(ArrayList<PaletteModel> paletteModelList) {
        this.paletteModelList = paletteModelList;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getSampleColor() {
        return sampleColor;
    }

    public void setSampleColor(String sampleColor) {
        this.sampleColor = sampleColor;
    }

    public int getGroupId() {
        return groupId;
    }

    public void setGroupId(int groupId) {
        this.groupId = groupId;
    }
}
